#pragma once
#include "ZuiLib.h"
#include "LRefObject.h"

namespace ZuiLib {

class LHorizontalLayout :public LRefObject<ZHorizontalLayout>
{
public:

	int getSepWidth(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetSepWidth());
	}

	int setSepWidth(LuaFuncState& L)
	{
		pThis->SetSepWidth(L.arg(0).toInt());
		return 0;
	}

	int isSepImmMode(LuaFuncState& L)
	{
		return L.lreturn(pThis->IsSepImmMode());
	}

	int setSepImmMode(LuaFuncState& L)
	{
		pThis->SetSepImmMode(L.arg(0).toBool());
		return 0;
	}


	BEGIN_MAP_FUNC(LHorizontalLayout)
		DECLARE_FUNC(getSepWidth),
		DECLARE_FUNC(setSepWidth),
		DECLARE_FUNC(isSepImmMode),
		DECLARE_FUNC(setSepImmMode),
	END_MAP_FUNC
};


class LVerticalLayout :public LRefObject<ZVerticalLayout>
{
public:

	int getSepHeight(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetSepHeight());
	}

	int setSepHeight(LuaFuncState& L)
	{
		pThis->SetSepHeight(L.arg(0).toInt());
		return 0;
	}

	int isSepImmMode(LuaFuncState& L)
	{
		return L.lreturn(pThis->IsSepImmMode());
	}

	int setSepImmMode(LuaFuncState& L)
	{
		pThis->SetSepImmMode(L.arg(0).toBool());
		return 0;
	}

	BEGIN_MAP_FUNC(LVerticalLayout)
	DECLARE_FUNC(getSepHeight),
	DECLARE_FUNC(setSepHeight),
	DECLARE_FUNC(isSepImmMode),
	DECLARE_FUNC(setSepImmMode),
	END_MAP_FUNC
};


class LTileLayout :public LRefObject<ZTileLayout>
{
public:

	int getFixedColumns(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetFixedColumns());
	}

	int setFixedColumns(LuaFuncState& L)
	{
		pThis->SetFixedColumns(L.arg(0).toInt());
		return 0;
	}

	int getChildVPadding(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetChildVPadding());
	}

	int setChildVPadding(LuaFuncState& L)
	{
		pThis->SetChildVPadding(L.arg(0).toInt());
		return 0;
	}

	int getItemSize(LuaFuncState& L)
	{
		return L.lreturn(toLua(&L, pThis->GetItemSize()));
	}

	int setItemSize(LuaFuncState& L)
	{
		pThis->SetItemSize(toSize(L.arg(0)));
		return 0;
	}

	int getColumns(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetColumns());
	}

	int getRows(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetRows());
	}

	BEGIN_MAP_FUNC(LTileLayout)
	DECLARE_FUNC(getFixedColumns),
	DECLARE_FUNC(setFixedColumns),
	DECLARE_FUNC(getChildVPadding),
	DECLARE_FUNC(setChildVPadding),
	DECLARE_FUNC(getItemSize),
	DECLARE_FUNC(setItemSize),
	DECLARE_FUNC(getColumns),
	DECLARE_FUNC(getRows),
	END_MAP_FUNC
};


class LLayout :public LRefObject<ZLayout>
{
public:

	BEGIN_MAP_FUNC(LLayout)

	END_MAP_FUNC
};

}//namespace
